package com.yxhl.zoume.core.tripsmgmt.info;


/**
 * Created by yxhl on 15/11/21.
 * modify by sugarya on 16/05/20
 */
public enum RideStatus {

    ERROR(0),
    /**
     * 未派车
     */
    UN_SEND(1),
    /**
     * 未上车
     */
    UN_TAKEN(2),
    /**
     * 已上车
     */
    TAKEN(3),
    /**
     * 已到站
     */
    ARRIVED(4),
    /**
     * 已取消
     */
    CANCEL(5);

    private int type;

    private RideStatus(int type) {
        this.type = type;
    }

    public static RideStatus getRideStatusByValue(int type) {
        for (RideStatus rideStatus : RideStatus.values()) {
            if (rideStatus.type == type) {
                return rideStatus;
            }
        }
        return ERROR;
    }

}
